package com.donzell.web.controller.comm;

public class Result {
	private static final int SUCC = 200;
	private static final int ERR = 500;
	public int result_code;
	public String result_msg;
	public Object data;
	
	public static Result getCommResult(){
		Result result = new Result();
		
		return result;
	}
	
	public static Result getSuccResult(){
		Result result = new Result();
		result.setResultcode(SUCC);
		result.setResultmsg("成功");
		result.setData(null);
		return result;
	}
	
	public static Result getSuccResult(Object data){
		Result result = new Result();
		result.setResultcode(SUCC);
		result.setResultmsg("成功");
		result.setData(data);
		return result;
	}
	
	public static Result getSuccResult(String result_msg,Object data){
		Result result = new Result();
		result.setResultcode(SUCC);
		result.setResultmsg(result_msg);
		result.setData(data);
		return result;
	}
	
	
	public static Result getErrResult(){
		Result result = new Result();
		result.setResultcode(ERR);
		result.setResultmsg("失败");
		result.setData(null);
		return result;
	}
	
	public static Result getErrResult(int resultCode,String result_msg){
		Result result = new Result();
		result.setResultcode(resultCode);
		result.setResultmsg(result_msg);
		result.setData(null);
		return result;
	}
	
	public static Result getErrResult(String result_msg){
		Result result = new Result();
		result.setResultcode(ERR);
		result.setResultmsg(result_msg);
		result.setData(null);
		return result;
	}
	
	public static Result getErrResult(Object data){
		Result result = new Result();
		result.setResultcode(ERR);
		result.setResultmsg("失败");
		result.setData(data);
		return result;
	}
	
	public static Result getErrResult(String result_msg,Object data){
		Result result = new Result();
		result.setResultcode(ERR);
		result.setResultmsg(result_msg);
		result.setData(data);
		return result;
	}
	
	public static Result getErrResult(int resultCode,String result_msg,Object data){
		Result result = new Result();
		result.setResultcode(resultCode);
		result.setResultmsg(result_msg);
		result.setData(data);
		return result;
	}
	
	
	public int getResultcode() {
		return result_code;
	}
	public void setResultcode(int result_code) {
		this.result_code = result_code;
	}
	public String getResultmsg() {
		return result_msg;
	}
	public void setResultmsg(String result_msg) {
		this.result_msg = result_msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	
	
}
